import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'


// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],
  // 配置前端服务地址和端口
  server: {
    host: '0.0.0.0',
    port: 5173,
    // 是否开启 https
    https: false,
    // 设置反向代理，跨域
    proxy: {
      '/api': {
        //  http://4gpm8g.natappfree.cc
        // 后台地址http://101.33.211.103:8888
        // 局域网http://172.16.106.58:8001
        // 局域网http://172.16.106.158:8004
        target: "http://101.33.211.103:8888",
        // target: 'http://101.33.211.103:8888',
        changeOrigin: true,
        rewrite: path => path.replace(/^\/api/, '')
      }
    }
  },

})
